const fs = require('fs');

const path = require('path');

const error = require('../../common/error');

module.exports=function(data,mode){

  const filePath = path.resolve(__dirname,'../../lib/'+mode+'.json');

  try {

    fs.writeFileSync(filePath,JSON.stringify(data),'utf8');

  } catch (e) {

    error("覆盖版本信息数据失败，联系作者：" + e.message);

  }
}